William Hamilton (1704–1754) was a Scottish poet associated with the Jacobite movement.
He was born at the family seat in Ecclesmachan, West Lothian, Scotland. He began his literary career by contributing verses to Allan Ramsay's Tea Table Miscellany. He joined Charles Edward Stuart in 1745, and celebrated the Battle of Prestonpans in his poem, Gladsmuir. After the Battle of Culloden, he wandered in the Highlands, where he wrote his Soliloquy and later escaped to France. His friends, however, succeeded in obtaining his pardon, and he returned to Scotland. In 1750, on the death of his brother, he succeeded to the family estate, but died not long afterwards, in Lyon, France. He also wrote The Episode of the Thistle and the ballad, The Braes of Yarrow. He died in Lyon.
This article incorporates text from a publication now in the public domain : Cousin, John William (1910). A Short Biographical Dictionary of English Literature. London, J. M. Dent & Sons; New York, E. P. Dutton.